<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To Export the BSOD results in text file and save it in a common Share path # Note: \\CommonSharePathName = Need to be hardcoded inside the script and the sharepath Must be accessible by everyone # Workflow: To collect event log data from a computer, filter for specific application logs related to blue screen errors, and then save that information to a shared network path. # Configuration Type - COMPUTER #> # Computer Name $Computer = $env:COMPUTERNAME # Define the output file path $outputFilePath = "\\CommonSharePathName\$Computer.txt" # Get the events $events = Get-EventLog -LogName application -Source 'Windows Error*' -After (Get-Date).AddDays(-30) | Where-Object { $_.Message -match 'bluescreen' } | Select-Object TimeWritten, Message | Format-Table -Wrap | Out-String # Save the output to a text file $events | Out-File -FilePath $outputFilePath -Force # Confirm the action Write-Host "Output saved to $outputFilePath"